﻿using System;
using System.Linq.Expressions;
using Sayook.Framework.DbCore.DbException;

namespace Sayook.Framework.DbCore.CreateSqlString
{
    public class CreateOracleSql : CreateSqlBase, ICreateSql
    {
        private CreateOracleSql()
        {
        }

        private static ICreateSql sqlBuilder;

        public static ICreateSql SqlBuilder()
        {
            if (sqlBuilder == null)
            {
                lock (obj)
                {
                    if (sqlBuilder == null)
                    {
                        sqlBuilder = new CreateOracleSql();
                    }
                }
            }
            return sqlBuilder;
        }

        /// <summary>
        /// 生成 指定读取行数 字句
        /// </summary>
        /// <param name="skipCount">跳过的行数</param>
        /// <param name="takeCount">读取的行数</param>
        /// <returns></returns>
        public string CreatePageing(int skipCount, int takeCount)
        {
            throw new CreateSqlException("Oreate 暂不支持分页查询！建议使用 FromSqlRaw() 原生sql语句查询");
        }

        public string CreateWhere<T, TElement>(Expression<Func<T, TElement>> expression)
        {
            throw new NotImplementedException();
        }

        public string CreateWhere<T, TElement, TValue>(Expression<Func<T, TElement>> expression, TValue value)
        {
            throw new NotImplementedException();
        }
    }
}